﻿using Newtonsoft.Json;

namespace VideoTools.vo
{
    public class VideoInfo: IComparable<VideoInfo>
    {
        public string path { get; set; }
        public string frameSize { get; set; }
        public string duration { get; set; }
        public string audioChannel {  get; set; }
        public string format {  get; set; }
        public string colorModel {  get; set; }
        
        public VideoInfo()
        {

        }
        public override int GetHashCode()
        {
            return path.GetHashCode();
        }

        public override string ToString()
        {
            return JsonConvert.SerializeObject(this);
        }

        public override bool Equals(object? obj)
        {
            if (obj is VideoInfo)
            {
                VideoInfo di = obj as VideoInfo;
                return this.path.Equals(di.path);
            }
            return false;
        }

        public int CompareTo(VideoInfo? other)
        {
            return path.CompareTo(other.path);
        }

        public VideoInfo(string path, string frameSize,string audioChannel,  string duration, string format,string colorModel)
        {
            this.path = path;
            this.frameSize = frameSize;
            this.duration = duration;
            this.audioChannel = audioChannel;
            this.format = format;
            this.colorModel = colorModel;
        }

        
    }
}
